home *** CD-ROM | disk | FTP | other *** search
/ Armageddon - Interactive Preview / Interactive Preview: Armageddon.iso / pc / control.dxr / Scripts & Behaviors_3_aCommObj.ls < prev    next >
Encoding:
Text File  |  1998-05-19  |  2.0 KB  |  51 lines

  1. property pDimBlip, pBrightBlip, pDisplaySprite
  2.  
  3. on new me, dimBlip, brightBlip, displaySprite
  4.   set pDimBlip to dimBlip
  5.   set pBrightBlip to brightBlip
  6.   set pDisplaySprite to displaySprite
  7.   set the visible of sprite pDisplaySprite to 0
  8.   updateStage()
  9.   return me
  10. end
  11.  
  12. on animate me
  13.   if the puppet of sprite pDimBlip = 0 then
  14.     puppetSprite(pDimBlip, 1)
  15.   end if
  16.   if the puppet of sprite pBrightBlip = 0 then
  17.     puppetSprite(pBrightBlip, 1)
  18.   end if
  19.   if the locH of sprite pDimBlip > 600 then
  20.     puppetSound(4, "Radar")
  21.     updateStage()
  22.     set the locH of sprite pDimBlip to 565
  23.     set the locV of sprite pDimBlip to 385 + random(2) - random(2)
  24.     set the locH of sprite pBrightBlip to 565
  25.     set the locV of sprite pBrightBlip to 385 + random(3) - random(3)
  26.     set the visible of sprite pDisplaySprite to 1
  27.     updateStage()
  28.     set the visible of sprite pDisplaySprite to 0
  29.   else
  30.     if the locH of sprite pDimBlip > 595 then
  31.       set the locH of sprite pDimBlip to the locH of sprite pDimBlip + 1
  32.       set the locV of sprite pDimBlip to 385 + random(2) - random(2)
  33.       set the locH of sprite pBrightBlip to the locH of sprite pDimBlip + 1
  34.       set the locV of sprite pBrightBlip to 385 + random(3) - random(3)
  35.     else
  36.       if random(5) > 3 then
  37.         set the locH of sprite pDimBlip to the locH of sprite pDimBlip + 1
  38.         set the locV of sprite pDimBlip to (sin(random(the locH of sprite pDimBlip)) * random(6)) + 385
  39.         set the locH of sprite pBrightBlip to the locH of sprite pDimBlip + 1
  40.         set the locV of sprite pBrightBlip to (sin(random(the locH of sprite pDimBlip)) * random(6)) + 385
  41.       else
  42.         set the locH of sprite pDimBlip to the locH of sprite pDimBlip + 1
  43.         set the locV of sprite pDimBlip to (sin(random(the locH of sprite pDimBlip)) * random(3)) + 385
  44.         set the locH of sprite pBrightBlip to the locH of sprite pDimBlip + 1
  45.         set the locV of sprite pBrightBlip to (sin(random(the locH of sprite pDimBlip)) * random(3)) + 385
  46.       end if
  47.     end if
  48.   end if
  49.   updateStage()
  50. end
  51.